
export default {
  mode: 'universal',
  /*
  ** Headers of the page
  */
  env: {
    // APIHOST: process.env.NODE_ENV !== 'production' ? '/api' : 'http://192.168.0.244:9090',
    // APIHOST: process.env.NODE_ENV !== 'production' ? '/api' : 'http://192.168.0.116:9003/hd',
    APIHOST: process.env.NODE_ENV !== 'production' ? '/api' : 'http://www.hdtun.com/hd', //线上地址
    // APIHOST: process.env.NODE_ENV !== 'production' ? '/api' : 'http://t.weijiandata.com:8888/hd', //可以在家访问的
  },
  router: {
    base: "/"
  },
  head: {
    title: '伙达',
    meta: [
      { charset: 'utf-8'},
      { name: 'viewport', content: 'user-scalable=0,width=device-width, initial-scale=1.0'},
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/halogo.ico'},
    ]
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#0096E6' },
  /*
  ** Global CSS
  */
  css: [
    '~assets/css/common.css', // 公共样式
    '~assets/css/main.css', // 页面过渡
    '~assets/css/font.css', // 自定义字体
    '~assets/fonts/iconfont.css', //阿里巴巴iconfont图
  ],
 
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '~/plugins/axios', // 请求插件
    { src: '~plugins/mixin.js'}, //this.go方法
    { src: '~plugins/echarts.js'},
    { src:'~plugins/clipboard.js'},
    { src: '~/plugins/common.js', ssr: false },
    { src: '~/plugins/ele.js', ssr:true},
    { src: '~plugins/lazyload.js', ssr:false},
    // { src: '~/plugins/router.js',ssr:false},
    { src: '~plugins/echarts-wordcloud.js', ssr: false },
    { src: '~assets/fonts/iconfont.js', ssr: false },
  ],
  /*
  ** Nuxt.js dev-modules
  */
  buildModules: [
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    '@nuxtjs/axios',
  ],
  axios: {
    proxy: true
  },
  proxy: {
    '/api/': {
    //  target: 'http://192.168.0.197:9003/',
    //  target: 'http://192.168.0.197:9090/',
      target: 'http://192.168.0.116:9003/hd',
      // target: 'http://192.168.0.244:9090',
      // target: 'http://t.weijiandata.com:8888/xhd',
      pathRewrite: {
        '^/api/': ''
      }
    }
  },
  transition: {
    name: 'page',
    mode: 'out-in',
    beforeEnter (el) {
      // console.log('Before enter...');
    }
  },
  output: {
    globalObject: 'this'
  },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** You can extend webpack config here
    */
    extend (config, ctx) {
      config.output.publicPath = '../_nuxt/'
    },
  }
}
